package com.example.springbootbaiduaidemo.controller;

import com.baidu.aip.imageclassify.AipImageClassify;
import com.example.springbootbaiduaidemo.utils.BaiduAiUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chaird
 * @create 2020-10-29 19:40
 */
@RestController
public class HelloController {

  @Autowired private BaiduAiUtils baiduAiUtils;

  @GetMapping("/hello")
  public Object hello() {
    Object o = baiduAiUtils.animalDetect("C:\\Users\\25682\\Desktop\\111.png");
    return o.toString();
  }

  @Autowired private AipImageClassify aipImageClassify;

  @GetMapping("/hello2")
  public Object hello2() {

    String ossUrl = "http://fdcp-file.oss-cn-beijing.aliyuncs.com/default/111.png";
    Object o = baiduAiUtils.animalDetectOss(ossUrl);

    return o.toString();


  }



}
